$(function() {
	$('#vue_vm_list').hide();
});

function elderPayReturnApply_findBySearchVal() {
	if($('#vue_vm_list').length==0) {return;}
	$('#vue_vm_list').hide();
	
	var searchVal = $('#searchVal').val();
	
	if(isEmpty(searchVal)) {
		alert('请输入长者姓名或身份证号');
		return;
	}
	
	openWaiting('正在查找');
	
	find_basic_by_json(path+'/elderPayReturnApply/findBySearchVal', {searchVal: searchVal}, function(response) {
		closeWaiting();
		
		$('#vue_vm_list').html(gl_vue_vm_list_html);
		
		new Vue({
			el: '#vue_vm_list',
			data: {
				todos: response.data
			},
			methods: {
				updateResult:function(todo) {
					var id = todo.withdrawApplyId;
					
					if(confirm('确实要处理退费吗？')) {
						save_basic_by_json(path+'/elderPayReturnApply/updateResult', {id:id}, function() {
							$('#'+todo.withdrawApplyId+'_handle_button').remove();
							alert('处理退费成功');
						});
					}
				}
			}
		});
		
		$('#vue_vm_list').show();
	});
}